<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
</head>
<body>
    <button type="button" id="query">请求数据</button>
    <div id="content" style="background-color: aquamarine; width:300px;height:500px"></div>
</body>
<script type="text/javascript">
    $("#query").click(function() {
        $.ajax(
            {
                url:"http://127.0.0.1:8021/u/v1/user/list",
                dataType : "json",
                type: "get",
                beforeSend: function (request) {
                    request.setRequestHeader("x-token", "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJJRCI6MjMsIk5pY2tOYW1lIjoiY3pjMiIsIkF1dGhvcml0eUlkIjoyLCJpc3MiOiJjemMiLCJleHAiOjE2NzM1ODA4ODUsIm5iZiI6MTY3MDk4ODg4NX0.cwAkmg3Nly2KTqluadhdUF8EbjAQhg9lntw2qhfvRYDRdhjD3cac_iwigOLn6TbT-pywnWJmbnSCu81aQ5O1PQ")
                },
                success: function(result) {
                    console.log(result.data)
                    $("#content").text(result.data)
                },
                error: function(data) {
                    alert("请求出错")
                }
            }
        );
    });
</script>
</html>